<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<%@ include file="../common/include/header.jsp" %>

<%@ page import="java.util.*,util.*" %>

<div>
<table border="0" cellpadding="0" cellspacing="0" width="980px">
	<tr>
		<td style="vertical-align: top;width: 180px;background-color: #fdb73a;">
			
<!-- Left Menu Including -->
<%@ include file="../common/include/leftmenu.jsp" %>
		</td>
		
		<td style="text-align: center;width: 800px; vertical-align: top;">

<!-- 여기서부터 게시판 내용 -->
<div id="noticeMain" style="text-align: center;background-color: #ffffff;">
<html:form action="noticeboard.do">
<table style="width: 800px;height: 100px;text-align: center;background-image: url('../common/image/communitybanner.jpg');background-repeat: no-repeat;">

<%@include file="logo.jsp" %>

<div class="boardname">공지사항</div>
<table style="width: 700px; text-align: center;" id="nlist">

	<tr><td style="width: 100px;padding-top: 10px;">작성자</td><td style="width: 540px;text-align: left;padding-top: 10px;"><bean:write name="noticeForm" property="mcnick"/>
		</td></tr>

<logic:notEmpty name="noticeForm" property="nbcounter">
	<tr><td style="width: 100px;">조회수</td><td style="width: 540px;text-align: left;"><bean:write name="noticeForm" property="nbcounter"/>
		</td></tr></logic:notEmpty>

	<tr><td style="width: 100px;">제목</td><td style="width: 540px;text-align: left;"><html:text property="nbtitle" size="70"></html:text>
		</td></tr>
		
	<tr><td colspan="2" style="height: 500px;">
	<textarea name="nbcontent" rows="10" cols="80" style="width:800px; height: 500px">
		<bean:write name="noticeForm" property="nbcontent"/>	
	</textarea>
		</td></tr>

	 	<tr><td colspan="2"><a href="javascript:validate();"><img src="<%=imagePath %>icon_update.jpg"/></a>
	</td></tr>

	<tr><td colspan="2">
	
	<a href="javascript:getBoard('noticeboard.do?method=getList&currentPage=<bean:write name="pager" property="currentPage"/>
	&cono=<bean:write name="noticeForm" property="cono"/>&fbname=','공지사항');"><img src="<%=imagePath %>icon_list.jpg"/></a>
		</td></tr>
</table>
	<input type="hidden" name="method" value="update"/>
	<input type="hidden" name="mid" value="<bean:write name="noticeForm" property="mid"/>"/>
	<input type="hidden" name="nbno" value="<bean:write name="noticeForm" property="nbno"/>"/>
	<input type="hidden" name="nbdate" value="<bean:write name="noticeForm" property="nbdate"/>"/>
	<input type="hidden" name="nbcounter" value="<bean:write name="noticeForm" property="nbcounter"/>"/>
	<input type="hidden" name="cono" value="<bean:write name="noticeForm" property="cono"/>"/>
</html:form>
</div>
<script type="text/javascript" src="<%=path %>/fckeditor/fckeditor.js"> </script>
<script type="text/javascript">
<!--

	window.attachEvent("onload", getfckeditor);
	 function getfckeditor(){
		var oFCKeditor = new FCKeditor( 'nbcontent' ) ;
		oFCKeditor.BasePath	= "<%=path%>/fckeditor/" ;
		oFCKeditor.ReplaceTextarea() ;
	}
	
	function validate(){
		var title = noticeMain.getElementsByTagName('input')[0].value;
		var check1 = title.replace(/\s/g,"");
		if(check1==""){			
			alert("제목은 반드시 입력해 주세요");
		}
		
		document.getElementById('noticeForm').submit();
		
	}

	
	function viewBoard(action,method,cono,nbname){
		var m = "<%=request.getParameter("method") %>";
		var url = action+"?method="+method;
		url = url + "&cono="+cono;
		url = url + "&nbname="+escape(encodeURIComponent(nbname));
		location.href=url;
	}
//-->
</script>
		</td>		
	</tr>
</table>
</div>
<script type="text/javascript">
<!--
	function getBoard(u,b){
		var url = u;
		url = url + escape(encodeURIComponent(b));
		location.href=url;
	}
//-->
</script>
<%@ include file="../common/include/footer.jsp" %>